import UserModel from '../models/user.model';
import { ObjectType } from '../types';
import { BaseInsertDto, BaseUpdateDto } from './.dto';

/** 用户列表DTO */
export class UserListDto implements ObjectType, Partial<UserModel> {
  id: string = '';
  username: string = '';
  email: string = '';
}

/** 用户单个DTO */
export class UserSingleDto implements ObjectType, Partial<UserModel> {
  id: string = '';
  username: string = '';
  email: string = '';
}

/** 用户创建DTO */
export class UserCreateDto extends BaseInsertDto implements Partial<UserModel> {
  username: string = '';
  password: string = '';
  email: string = '';
}

/** 用户更新DTO */
export class UserUpdateDto extends BaseUpdateDto implements Partial<UserModel> {
  username: string = '';
  email: string = '';
}

/**
 * @swagger
 * components:
 *   schemas:
 *     UserListDto:
 *       type: object
 *       properties:
 *         id:
 *           type: integer
 *           description: 用户的唯一标识符
 *           example: 1
 *         username:
 *           type: string
 *           description: 用户名，用户在系统中的标识
 *           example: 'zhangsan'
 *         email:
 *           type: string
 *           description: 用户的电子邮件地址，用于登录和通知
 *           example: user@example.com
 *     UserSingleDto:
 *       allOf:
 *         - $ref: '#/components/schemas/UserListDto'
 *     UserCreateDto:
 *       type: object
 *       properties:
 *         username:
 *           type: string
 *           description: 用户名，用户在系统中的标识
 *           example: 'zhangsan'
 *         password:
 *           type: string
 *           description: 用户的密码，确保安全性
 *           example: 'password123'
 *         email:
 *           type: string
 *           description: 用户的电子邮件地址，用于登录和通知
 *           example: user@example.com
 *     UserUpdateDto:
 *       type: object
 *       properties:
 *         username:
 *           type: string
 *           description: 用户名，用户在系统中的标识
 *           example: 'zhangsan'
 *         email:
 *           type: string
 *           description: 用户的电子邮件地址，用于登录和通知
 *           example: user@example.com
 */
